<!--{if $payform.code_url}-->
<!DOCTYPE html>
<html>
<head>
<meta charset="{$app->charset}">
<title>{$lang.wxnativepay}</title>
<style>
body {
	text-align: center;
	background: #333;
	padding: 50px;
}
.w {
	margin: 0 auto;
}
.hd {
	color: #fff;
	font-size: 20px;
	line-height: 32px;
}
.bd .qrcode {
	width: 280px;
	height: 280px;
	border: 1px #E2E2E2 solid;
	margin-top: 15px;
}
.bd .status {
	box-shadow: inset 0 5px 10px -5px #191919, 0 1px 0 0 #444;
	border-radius: 100px;
	background-color: #232323;
	padding: 14px 14px;
	width: 252px;
	margin: 0 auto;
	margin-top: 15px;
	color: #fff;
}
</style>
</head>
<body>
<div class="w">
  <div class="hd">{$lang.wxnativepay}</div>
  <div class="bd">
    <p><img class="qrcode" alt="{$lang.wxnativepay}" src="{url route='cashier/wxnativepay' code=$payform.code_url}" /></p>
    <div class="status">{$lang.use_wxnativepay}</div>
  </div>
</div>
<script type="text/javascript" src="{lib file='jquery-1.11.1.js'}" charset="{$app->charset}"></script>
<script type="text/javascript">
$(function(){
	$.ajaxSettings.async = false;
	var interval = setInterval(function() {
    	$.getJSON("{url route='cashier/checkpay'}", { payTradeNo:"{$payform.payTradeNo}"}, function(result) {
        	if(result != false){
				clearInterval(interval);
				self.location = "{url route='paynotify/index' payTradeNo=$payform.payTradeNo}";
			}
    	});
	}, 3000);
});
</script>
</body>
</html>
<!--{else}-->
<!DOCTYPE html>
<html>
<head>
<meta charset="{$app->charset}">
<style>
.payform-submit {
	margin: 20px;
	border: 1px #40B3FF solid;
	padding: 20px;
	background: #E5F5FF;
	font-weight: normal;
	font-size: 16px;
}
</style>
</head>
<body>
<div class="payform-submit">{$lang.connecting_pay_gateway}</div>
<form action="{$payform.gateway}" id="payform" method="{$payform.method}" style="display:none">
  <!-- {foreach from=$payform.params item=_v key=_k} -->
  <input type='hidden' name='{$_k}' value='{$_v}' />
  <!-- {/foreach} -->
</form>
<script type="text/javascript">
	document.getElementById('payform').submit();
</script>
</body>
</html>
<!--{/if}-->